<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<link href="{TPL}css/NewTopFoot.css" rel="Stylesheet" type="text/css">
<link type="text/css" rel="stylesheet" href="{TPL}css/AddItemPanel.css">
<meta content="{lang Recommendation_purchasing_apparel_skin_care_food}" name="keywords">
<meta content="{lang What_Shopping_what_delicious_Chinese_you}" name="description">
<link type="text/css" rel="stylesheet" href="{TPL}css/pages.css">
<link type="text/css" rel="stylesheet" href="{TPL}css/sharetao.css">
<link type="text/css" rel="stylesheet" href="{TPL}css/jquery-ui.css">
<title>
	[{$cfg_site_name}-{lang Recommended}] -{lang Chinese_purchase_purchasing_immediately}！
</title></head>
<body>
<script src="{TPL}js/sharetao/common.js" type="text/javascript"></script>
<script src="{TPL}js/sharetao/jquery.min.js" type="text/javascript"></script>    
<script src="{TPL}js/sharetao/jquery.form.js" type="text/javascript"></script>
<script src="{TPL}js/sharetao/JqueryAjax.js" type="text/javascript"></script>
{template 'header_share'}
<div class="stbody">
<div class="stwarp">
  <div class="st_nav_warp">
  	<input value="/meilijie" id="myurl" type="hidden">
    <div class="st_nav_tips"><img src="{TPL}images/sharetao/stnav_lg.gif" alt="与大家一起分享淘宝的乐趣吧！"></div>
    <div class="st_nav">
      <ul>
       <li class="stn_yf"><a href="{url_sharetao.php?gtypeid=1}">衣服</a></li>
       <li id="st_nav_line"></li>
       <li class="stn_xz"><a href="{url_sharetao.php?gtypeid=2}">鞋包</a></li>
       <li id="st_nav_line"></li>
       <li class="stn_bb"><a href="{url_sharetao.php?gtypeid=3}">美容</a></li>
       <li id="st_nav_line"></li>
       <li class="stn_mz"><a href="{url_sharetao.php?gtypeid=4}">居家</a></li>
       <li id="st_nav_line"></li>
       <li class="stn_ps"><a href="{url_sharetao.php?gtypeid=5}">配饰</a></li>
       <li id="st_nav_line"></li>
       <li class="stn_ms"><a href="{url_sharetao.php?gtypeid=6}">食品</a></li>
      </ul>
    </div>
  </div>
  <!--顶部导航结束-->
  <!--面包屑导航开始-->
<div class="bnav">
  您现在的位置：<a href="{url_index.php}">首页</a><span>&gt;</span><a href="{url_sharetao.php}">分享</a>	 			
</div>
<!--面包屑导航开始-->
  <div class="st_search_warp" style="display:none">
    	  	<div id="st_srch_zx_sel" class="st_srch_zx"><a name="hot" href="http://www.ecward.com/sharetao/iniIndex/hot/1">最新</a></div>
	    <div class="st_srch_hot"><a name="hot" href="http://www.ecward.com/sharetao/iniIndex/hot/2">7天最热</a></div>
	    <div class="st_srch_hot"><a name="hot" href="http://www.ecward.com/sharetao/iniIndex/hot/3">30天最热</a></div>
	    <div class="st_srch_right">
      <div class="st_srch_r_l">
        <b>热门搜索：</b>
		<strong>
		<a href="http://www.ecward.com/sharetao/iniIndex/types/7">情人节</a>
		</strong>
		<strong>
		<a href="http://www.ecward.com/sharetao/iniIndex/types/6">红</a>
		</strong>
		<strong>
		<a href="http://www.ecward.com/sharetao/iniIndex/types/3">减肥</a>
		</strong>
		<a href="http://www.ecward.com/sharetao/iniIndex/types/5">iPhone</a>
		<a href="http://www.ecward.com/sharetao/iniIndex/types/4">PARTY装备</a>
		<a href="http://www.ecward.com/sharetao/iniIndex/types/1">吃货</a>
		<a href="http://www.ecward.com/sharetao/iniIndex/types/2">内衣</a>
		
      </div>
      <form id="myForm" method="POST">
	      <div class="st_srch_r_r">
	        <input name="search" value="搜宝贝、找人" class="st_srch_r_txt fl" type="text">
	        <a onclick="javascript:sub('/sharetao/iniIndex');" class="st_srch_r_btn fr"></a>
	      </div>
	  </form>
    </div>
  </div>
  <!--搜索栏结束-->



  <div class="st_main">
	{loop $listarray $key $dataarr}	
    <div class="st_block">
	{if $key==0}
		<div class="st_share_bb">
			<div class="st_shb_text">
				<p>你最近代购了什么宝贝，挑选你喜欢的，分享给大家吧！</p>
				<a class="st_shb_btn" href="{url_m.php?name=recommend}"></a>
			</div>
			<div class="st_shb_ding"><img src="{TPL}images/sharetao/stding.gif"></div>
		</div>
		<!--分享宝贝按钮层.固定层-->
	  {/if}
	 {loop $dataarr $r}
	<div class="st_share">
		<div class="st_share_top">
			<div class="st_sht_pic">
				<a target="_blank" href="{url_sharetao.php?action=view&gid=$r['gid']}"><img style="width:178px;" original="{$r['goodsimg']}" src="{$r['goodsimg']}"></a>
			</div>
			<div class="st_sht_like">
				<div class="st_like_btnbg">
					<form method="POST" action="{url_sharetao.php?share_like=xihuanyixia}">
						<input name="tao_id" value="{$r['gid']}" type="hidden" />
						<input class="st_like_btn" name="like" value="" type="button" />
						<div style="display: none;" class="like_over"><a name="like_over" href="javascript:void();">取消</a></div>
						<input name="NoLike" value="" type="hidden" />
					</form>
				</div>
				<div class="st_like_num">				
					{eval 
					$gid=$r['gid'];
					include_once(INC_PATH.'/table.class.php');
					$likeobj=new TableClass('goodslike','lid');	
					$pingobj=new TableClass('goodscomment','cid');						
					$like_count=$likeobj->getcount("state = 1 and gid = '$gid'");
					$ping_count=$pingobj->getcount("state = 1 and gid = '$gid'");
					}			
					<div class="st_like_numl"></div>
					<div class="st_like_numm">{$like_count}</div>
					<div class="st_like_numr"></div>
				</div>
				<div class="st_like_pinglun"><a href="javascript:void(0)">{$ping_count}<span class="plks">评论</span></a></div>
			</div>
			<!--快速评论开始-->
			<form method="POST" action="{url_sharetao.php?common=share_common}">
				<input name="taoid" value="{$r['gid']}" type="hidden"/>
				<div class="ksplbox" style="display: none;">
					<div class="kspl_head"><img onerror="this.src='{TPL}images/sharetao/vip.gif'" alt="{$_USERS['showname']}" src="{$_USERS['face']}" height="26" width="26"></div>
					<div class="kspl_right">
						<textarea class="kspl_txt" maxlength="100" name="txtcommentss"></textarea>
						<div class="kspl_tool">
							<div class="kspl_bqbox posr">
								<input class="kspl_bq" value="" type="button">
								<!--表情开始-->
								<div class="biaoqing2" style="top:5px; left:-20px; display: none;">
									<ul>
										<li><img src="{TPL}images/sharetao/head/baipu.gif" title="摆谱" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/biaoyan.gif" title="表演" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/budong.gif" title="不懂" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/chifan.gif" title="吃饭" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/chinai.gif" title="吃奶" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/danding.gif" title="淡定" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/fankun.gif" title="犯困" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/jiaoao.gif" title="骄傲" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/juhan.gif" title="巨寒" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/lenghan.gif" title="冷汗" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/luguo.gif" title="路过" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/paishou.gif" title="拍手" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/piaoguo.gif" title="飘过" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/shangxin.gif" title="伤心" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/songhua.gif" title="送花" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/wuliao.gif" title="无聊" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/yinxiao.gif" title="阴笑" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/yunle.gif" title="晕了" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/zoule.gif" title="走了" height="24" width="24"></li>
										<li><img src="{TPL}images/sharetao/head/zuocao.gif" title="做操" height="24" width="24"></li>
										<p class="cl"></p>
									</ul>
								</div>
								<!--表情结束-->
							</div>
							<div class="kspl_plbox"><input name="btnPinlun2" class="kspl_pl" value="" type="button"></div>
						</div>
					</div>
					<div class="cl"></div>
				</div>
			</form>
			<!--快速评论结束-->
		</div>
		<div class="like_huifu">
			<div class="like_hf_user">
				<dl>			
					{eval 
					$uid=$r['uid'];
					include_once(INC_PATH.'/table.class.php');
					$userobj=new TableClass('users','uid');
					$uservalue=$userobj->getone($uid);
					}				
					<dt><img original="{$uservalue['face']}" onerror="this.src='{TPL}images/sharetao/vip.gif'" alt="{$r['uname']}" src="{$uservalue['face']}" height="32" width="32"></dt>
					<dd><span class="redf06">{$r['uname']}</span></dd>
					<dd><span>{echo date('Y-m-d H:i:s',$r['addtime'])}</span></dd>
					<div class="cl"></div>
				</dl>
			</div>
			<div class="like_hf_info">{$r['why']}</div>
		</div>
		<!--图片+喜欢数+评论数结束-->
		{eval 
		$gid=$r['gid'];
		include_once(INC_PATH.'/table.class.php');
		$commonobj=new TableClass('goodscomment','cid');
		$comarray=$commonobj->getdata(2,"gid='$gid' and state=1",'cid desc','cid,uid,uname,content,addtime');
		}
		{loop $comarray $com}
		<div class="like_plun">
			<div class="like_hf_user">
				<dl>
					{eval 
					$uid=$com['uid'];
					include_once(INC_PATH.'/table.class.php');
					$userobj=new TableClass('users','uid');
					$uservalue=$userobj->getone($uid);
					}					
				<dt><img  onerror="this.src='{TPL}images/sharetao/vip.gif'" alt="{$com['uname']}" src="{$uservalue['face']}" height="32" width="32" /></dt>
				<dd><span class="redf06">{$com['uname']}</span></dd>
				<dd><span>{echo date('Y-m-d H:i:s',$com['addtime'])}</span></dd>
				<div class="cl"></div>
				</dl>
			</div>
			<div class="like_hf_info">{Char_biaoqing($com['content'])}</div>
		</div>
		{/loop}
		<!--回复内容结束-->
	</div> 
	{/loop}
	</div>
{/loop}	

</div>
  <!--中间主要内容部分结束-->
  <!--底部分页开始-->
   <div class="cl"></div>
	<div class="st_page">
	{echo pagelist($total,$pagesize,$page,"");}		
	</div>
  <!--底部分页开始-->
</div>
</div>

<script type="text/javascript" src="{TPL}js/sharetao/jquery.form.js"></script>
<script type="text/javascript" src="{TPL}js/sharetao/JqueryAjax.js"></script>
<script type="text/javascript" src="{TPL}js/sharetao/common.js"></script>
<script type="text/javascript" src="{TPL}js/sharetao/jquery.lazyload.js"></script>
<script type="text/javascript">
	$(function(){
		//图片延迟加载*fuxiaochun.com*/       
    	$(".st_sht_pic img,.like_hf_user dt img").lazyload({
			placeholder : "/Images/sharetao/grey.gif",
            effect:"fadeIn",
			failurelimit : 20
         })
			//关闭提示
		$(".close").click(function(){
			$(this).parent("div").hide();
		});
		 var w=$(".st_sht_pic img").width();
	     var h=$(".st_sht_pic img").height();
	     var x=(w*178)/h;
	     $(".st_sht_pic img").css({"width":"178px","height":"x"})		
		$(".st_like_btn").click(function(){
			$(this).parents("form").submit();
		});
		$("[name=like_over]").click(function(){
			$(this).parent().fadeOut();
			$(this).parent().next("[name=NoLike]").val("shanchu");
			$(this).parents("form").submit();
		});
		$(".lp_close").click(function(){
			$(this).parent(".like_pinglun").fadeOut();
		});
		$("[name=search]").focus(function(){
			if($(this).val()=="搜宝贝、找人"){
				$(this).val("");
			}	
		});
		$("[name=search]").blur(function(){
			if($(this).val()==""){
				$(this).val("搜宝贝、找人");	
			}	
		});
		$("[name=lp_close]").click(function(){
			$(this).parents(".like_pinglun").fadeIn();
		});
		$("[name=btnPinlun]").click(function(){
			if($(this).parent().parent().find("textarea").val()==""){
				alert("请输入评论内容");
				return false;
			}
			$(this).parents("form").submit();
		});
		
		//快速评论
		$(".plks").click(function(){
			$(this).parent().parent().parent().next().find(".ksplbox").toggle();				  
		})
		$(".kspl_bq").click(function(){
			//alert($(this).find(".biaoqing2"));
			//$(this).parent(".kspl_bqbox").find(".biaoqing2").css("display","block");
			//alert($(this).parent(".kspl_bqbox").find(".biaoqing2").length);
			$(this).next(".biaoqing2").toggle();						 
			//alert($(this).parent(".kspl_bqbox").find(".biaoqing2").css("display"));
		})
		//点击图片
		$(".biaoqing2 li").children("img").click(function(){
			insertAtCursor($(this).parents(".ksplbox").find("[name=txtcommentss]").get(0),"["+$(this).attr('title')+"]");
		});
		//快速评论按钮点击事件
		$("[name=btnPinlun2]").click(function(){
			if($(this).parents(".ksplbox").find("textarea").val()==""){
				alert("请输入评论内容");
				return false;
			}
			$(this).parents("form").submit();
		});
	})	
//解决光标处插入数据问题
function insertAtCursor(myField, myValue) {
  // IE
      if (document.selection)  
    {  
    myField.focus();  
    sel = document.selection.createRange();  
    sel.text = myValue;  
    sel.select();  
    }  
else if (myField.selectionStart || myField.selectionStart == '0') {
          // MOZILLA/NETSCAPE support
          //起始位置
          var startPos = myField.selectionStart;		
          //结束位置
          var endPos = myField.selectionEnd;
		  $content=$(myField).val();
          //插入信息
		  $(myField).val($content.substr(0,startPos)+myValue+$content.substr(endPos,$content.length));
      } else {
          //没有焦点的话直接加在TEXTAREA的最后一位
          myField.innerHTML += myValue;
      }
} 	
function doResultLike(data){
	var data = eval("(" + data + ")")['data'];
	if (data != null) {
		if (data['count'] != null) {
			var tao_id = data['tao_id'];
			var count = data['count'];
			var $tao = $("[name=tao_id]");
			for (var i = 0; i < $tao.length; i++) {
				if ($tao.eq(i).val() == tao_id) {
					$tao.eq(i).parents(".st_sht_like").find(".st_like_numm").html(count);
					if(data['NoLike']==null){
						$tao.eq(i).parents(".st_sht_like").find(".like_pinglun").fadeIn();
						$pinlun = $tao.eq(i).parents(".st_sht_like").find(".like_pinglun");
						c=setTimeout(function pinlun(){$pinlun.fadeOut()},3000);
						$pinlun.find("[name=txtcommentss]").focus(function(){
							clearTimeout(c);
						});
					}else{
						$div = $tao.eq(i).parents(".st_sht_like").find(".like_pinglun");
						$tao.eq(i).parents(".st_sht_like").find("[name=NoLike]").val("");
					}			
				}
			}
		}
		else {
			var tao_id = data['tao_id'];
			var $tao = $("[name=tao_id]");
			for (var i = 0; i < $tao.length; i++) {
				if ($tao.eq(i).val() == tao_id) {
					$tao.eq(i).parents(".st_sht_like").find(".like_over").fadeIn();
					$likeover =$tao.eq(i).parents(".st_sht_like").find(".like_over");
					setTimeout(function likeover(){$likeover.fadeOut()},3000);
				}
			}
		}
	}else{
		window.location.href="/User/index";
	}
}
</script>
{template 'footer'}
</body>
</html>
